#ifndef BALL_IN_LINE_H
#define BALL_IN_LINE_H

#include "common.h"
#include "ball_free.h"
#include "game_functions.h"

class Ball_in_line {
	friend class Balls_list;
public:
	Ball_in_line(unsigned int point_num):point_num(point_num) { create_color(); }
	Ball_in_line(unsigned int point_num, color_t color):point_num(point_num), color(color){}

	void draw(Point &point)
	{
		setfillcolor(color);
		fillellipse(point.x, point.y, BALL_RADIUS, BALL_RADIUS);
	}
	void move(void)
	{
		point_num += BALL_IN_LINE_SPEED;
	}
	void move(int move_distance)
	{
		point_num += move_distance;
	}
	
private:
	unsigned int point_num;
	color_t color;

	color_t color_array[3] = { RED, GREEN, YELLOW };
	void create_color(void)
	{
		color = color_array[random(3)];
	}
};

#endif
